// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2025 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.16.10
package sysin

import (
	"context"
	"hotgo/internal/consts"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"
	"hotgo/utility/validate"

	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/os/gtime"
)

// UserVideoUpdateFields 修改用户视频管理字段过滤
type UserVideoUpdateFields struct {
	ActivityId int         `json:"activityId" dc:"活动id"`
	Uid        int         `json:"uid"        dc:"用户id"`
	Number     string      `json:"number"     dc:"参赛号码"`
	VideoUrl   string      `json:"videoUrl"   dc:"视频路径"`
	Path       string      `json:"path"       dc:"预览地址"`
	CreateAt   *gtime.Time `json:"createAt"   dc:"添加时间"`
	UpdateAt   *gtime.Time `json:"updateAt"   dc:"更新时间"`
	Status     int         `json:"status"     dc:"状态，0正常"`
}

// UserVideoInsertFields 新增用户视频管理字段过滤
type UserVideoInsertFields struct {
	ActivityId int         `json:"activityId" dc:"活动id"`
	Uid        int         `json:"uid"        dc:"用户id"`
	Number     string      `json:"number"     dc:"参赛号码"`
	VideoUrl   string      `json:"videoUrl"   dc:"视频路径"`
	Path       string      `json:"path"       dc:"预览地址"`
	CreateAt   *gtime.Time `json:"createAt"   dc:"添加时间"`
	UpdateAt   *gtime.Time `json:"updateAt"   dc:"更新时间"`
	Status     int         `json:"status"     dc:"状态，0正常"`
}

// UserVideoEditInp 修改/新增用户视频管理
type UserVideoEditInp struct {
	entity.UserVideo
}

func (in *UserVideoEditInp) Filter(ctx context.Context) (err error) {

	return
}

type UserVideoEditModel struct{}

// UserVideoDeleteInp 删除用户视频管理
type UserVideoDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *UserVideoDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type UserVideoDeleteModel struct{}

// UserVideoViewInp 获取指定用户视频管理信息
type UserVideoViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *UserVideoViewInp) Filter(ctx context.Context) (err error) {
	return
}

type UserVideoViewModel struct {
	entity.UserVideo
}

// UserVideoListInp 获取用户视频管理列表
type UserVideoListInp struct {
	form.PageReq
	Id                int    `json:"id"                dc:"id"`
	Status            int    `json:"status"            dc:"状态，0正常"`
	ActivityTitle     string `json:"activityTitle"     dc:"活动名称"`
	ActivityUserName  string `json:"activityUserName"  dc:"姓名"`
	ActivityUserPhone string `json:"activityUserPhone" dc:"手机号"`
}

func (in *UserVideoListInp) Filter(ctx context.Context) (err error) {
	return
}

type UserVideoListModel struct {
	Id                int         `json:"id"                dc:"id"`
	ActivityId        int         `json:"activityId"        dc:"活动id"`
	Uid               int         `json:"uid"               dc:"用户id"`
	Number            string      `json:"number"            dc:"参赛号码"`
	VideoUrl          string      `json:"videoUrl"          dc:"视频路径"`
	Path              string      `json:"path"              dc:"预览地址"`
	CreateAt          *gtime.Time `json:"createAt"          dc:"添加时间"`
	UpdateAt          *gtime.Time `json:"updateAt"          dc:"更新时间"`
	Status            int         `json:"status"            dc:"状态，0正常"`
	ActivityTitle     string      `json:"activityTitle"     dc:"活动名称"`
	ActivityUserName  string      `json:"activityUserName"  dc:"姓名"`
	ActivityUserPhone string      `json:"activityUserPhone" dc:"手机号"`
}

// UserVideoExportModel 导出用户视频管理
type UserVideoExportModel struct {
	Id                int         `json:"id"                dc:"id"`
	ActivityId        int         `json:"activityId"        dc:"活动id"`
	Uid               int         `json:"uid"               dc:"用户id"`
	Number            string      `json:"number"            dc:"参赛号码"`
	VideoUrl          string      `json:"videoUrl"          dc:"视频路径"`
	Path              string      `json:"path"              dc:"预览地址"`
	CreateAt          *gtime.Time `json:"createAt"          dc:"添加时间"`
	UpdateAt          *gtime.Time `json:"updateAt"          dc:"更新时间"`
	Status            int         `json:"status"            dc:"状态，0正常"`
	ActivityTitle     string      `json:"activityTitle"     dc:"活动名称"`
	ActivityUserName  string      `json:"activityUserName"  dc:"姓名"`
	ActivityUserPhone string      `json:"activityUserPhone" dc:"手机号"`
}

// UserVideoStatusInp 更新用户视频管理状态
type UserVideoStatusInp struct {
	Id     int `json:"id" v:"required#id不能为空" dc:"id"`
	Status int `json:"status" dc:"状态"`
}

func (in *UserVideoStatusInp) Filter(ctx context.Context) (err error) {
	if in.Id <= 0 {
		err = gerror.New("id不能为空")
		return
	}

	if in.Status <= 0 {
		err = gerror.New("状态不能为空")
		return
	}

	if !validate.InSlice(consts.StatusSlice, in.Status) {
		err = gerror.New("状态不正确")
		return
	}
	return
}

type UserVideoStatusModel struct{}